package org.jeecg.modules.crawler.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.crawler.entity.CueCrawlerInfo;

/**
 * @Description: 爬虫信息
 * @Author: jeecg-boot
 * @Date:   2020-05-02
 * @Version: V1.0
 */
public interface CueCrawlerInfoMapper extends BaseMapper<CueCrawlerInfo> {
    /**
     * 初始化关键词
     * @return
     */
    public List<String> initKeyword();

    /**
     * 初始化规则
     * @return
     */
    public Map<String,Object> initRule();

    /**
     * 清楚关键词
     */
    public void clearKeyword();

    /**
     * 设置关键词
     * @param keywordArr
     */
    public void setKeyword(@Param("keywordArr") String[] keywordArr);

    /**
     * 设置规则
     * @param paramMap
     */
    public void ruleOk(Map<String, Object> paramMap);

    public void updateCrawlerRule(String rule);


    /**
     * 改变爬虫状态
     * @param id
     * @param state
     */
    public void changeCrawlerState(@Param("id") String id, @Param("state") String state);

    /**
     * 查询爬虫执行记录
     * @param id
     * @return
     */
    public List<Map<String,Object>> querySpiderLog(String id);
}
